package com.it.xiaotao;

import com.it.xiaotao.concurrent.ConcurrentMap;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;

public class TestMianShi2 {
	private static ConcurrentMap map = new ConcurrentMap();

	private static CountDownLatch countDownLatch = new CountDownLatch(2);

	public static void main(String[] args) throws InterruptedException {
		new Thread(() -> {
			map.put("name", "thread1");
			countDownLatch.countDown();
		}).start();
		new Thread(() -> {
			map.put("name", "thread2");
			countDownLatch.countDown();
		}).start();
		countDownLatch.await();
		System.out.println(map.get());

		if (1 == 1) {
			//
		} else {

		}
	}

	private static void print() throws InterruptedException {

	}
}
